package com.tsinghua.server.riskmodel.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tsinghua.server.common.Result;
import com.tsinghua.server.riskmodel.entity.*;
import com.tsinghua.server.riskmodel.service.*;
import com.tsinghua.server.train.entity.FxjcZqBase;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @description:
 * @author: Mr.Eric
 * @create: 2022/3/12 22:21
 */
@RestController
@RequestMapping(value = "evaluation")
public class EvaluationController {


    @Resource
    private FxjcBxEvaluationResultService bxEvaluationResultService;
    @Resource
    private FxjcCtzEvaluationResultService ctzEvaluationResultService;
    @Resource
    private FxjcCyzEvaluationResultService cyzEvaluationResultService;
    @Resource
    private FxjcYhEvaluationResultService yhEvaluationResultService;
    @Resource
    private FxjcZqEvaluationResultService zqEvaluationResultService;



//    @GetMapping(value = "list")
//    public Result datalist(@RequestParam(name = "type", required = false) Integer type){
//        switch (type){
//            case 1:
//            //    Page<FxjcCtzEvaluationResult> ctzPage = new Page<>(pageNo , pageSize);
//                return Result.succ(ctzEvaluationResultService.list());
//            case 2:
//             //   Page<FxjcCyzEvaluationResult> cyzPage = new Page<>(pageNo , pageSize);
//                return Result.succ(cyzEvaluationResultService.list());
//            case 3:
//             //   Page<FxjcYhEvaluationResult> yhPage = new Page<>(pageNo , pageSize);
//                return Result.succ(yhEvaluationResultService.list());
//            case 4:
//             //   Page<FxjcBxEvaluationResult> bxPage = new Page<>(pageNo , pageSize);
//                return Result.succ(bxEvaluationResultService.list());
//            case 5:
//             //   Page<FxjcZqEvaluationResult> zqPage = new Page<>(pageNo , pageSize);
//                return Result.succ(zqEvaluationResultService.list());
//        }
//
//        return Result.succ(null);
//    }


    /**
     *
     * @return
     */
    @GetMapping(value = "list")
    public Result datalist() {
        HashMap map = new HashMap<>();
        map.put("ctz",ctzEvaluationResultService.list());
        map.put("cyz",cyzEvaluationResultService.list());
        map.put("yh",yhEvaluationResultService.list());
        map.put("bx",bxEvaluationResultService.list());
        map.put("zq",zqEvaluationResultService.list());
        return Result.succ(map);
    }

}
